//-
//- Copyright (c) Microsoft. All rights reserved.
//- Licensed under the MIT license. See LICENSE file in the project root for full license information.
//-

extends ../layout

block content
  div.container

    if publicMembership
      h1
        | Thanks for supporting #{organization.name}
      p.lead Your membership is currently public
      p If you conceal your membership, you won't appear in the #{organization.name} member list or count.
    else
      h1 Want to publish your #{organization.name} organization membership?
      p.lead Show your support for #{config.brand.companyName} open source!
      p Publicizing your organization memberships is great for building community and reputation. If you to make your membership public, GitHub shows the "#{organization.name}" avatar on <a href="https://github.com/#{user.github.username}" target="_new">your public GitHub profile</a> and shows you on the <a href="https://github.com/orgs/#{organization.name}/people" target="_new">members page for #{organization.name}</a>.

    if user && user.github.increasedScope === true
      p &nbsp;
      form(method='post')
        p
          input.btn.btn-lg.btn-primary(type='submit', value=publicMembership ? 'Conceal my membership' : 'Make my membership public', name=publicMembership ? 'conceal' : 'publicize')
          | &nbsp; &nbsp;
          if onboarding || joining
            a.btn.btn-default.btn-lg(href=organization.baseUrl + 'teams' + teamPostfix)
              if publicMembership
                | Keep it public
              else
                | Keep it hidden
          else
            a.btn.btn-default.btn-lg(href=organization.baseUrl) Cancel

    else
      p.lead Quick way: Authorize us to publish on your behalf
      p.
        Temporarily authorize this site to have
        <a href="https://developer.github.com/v3/oauth/#scopes" target="_new"><code>write:org</code></a>
        permissions and immediately publish your organization membership.
      p
        a.btn.btn-primary.btn-lg(href='/signin/github/increased-scope') Publish Membership
        if (!(onboarding || joining))
          | &nbsp; &nbsp;
          a.btn.btn-default(href=organization.baseUrl) Cancel

      if onboarding || joining
        p.lead Manual way: Follow this process
        ul
          li Head over to the <a href="https://github.com/orgs/#{organization.name}/people">#{organization.name} list of people</a>.
          li Find yourself in the list and change the Public/Private setting.
        p
          a.btn.btn-default.btn-lg(href=organization.baseUrl + 'teams' + (onboarding ? '?onboarding=' + onboarding : '')) Continue without publishing

    if onboarding
      p &nbsp;
      hr
      h3 Your onboarding progress
      h5
        | Sign in to your GitHub &amp; #{config.brand.companyName} accounts&nbsp;
        i.glyphicon.glyphicon-ok
      h5
        | Link your accounts&nbsp;
        i.glyphicon.glyphicon-ok
      h5
        | Join your first GitHub organization&nbsp;
        i.glyphicon.glyphicon-ok
      h5
        | Multifactor security checkup&nbsp;
        i.glyphicon.glyphicon-ok
      h5
        | Profile review&nbsp;
        i.glyphicon.glyphicon-ok
      h5.text-primary
        | Publish your membership <em>(optional)</em>
      h5
        | Join a team <em>(optional)</em>
